Make return types G_CONST_RETURN instead of const.
authorMatthias Clasen <mclasen@redhat.com>
Tue, 9 Nov 2004 19:15:44 +0000 (19:15 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 9 Nov 2004 19:15:44 +0000 (19:15 +0000)
2004-11-09  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkaction.[hc]:
* gtk/gtkactiongroup.[hc]: Make return types G_CONST_RETURN
instead of const.

* gtk/gtk.symbols:
* gtk/gtkaction.h:
* gtk/gtkaction.c (gtk_action_get_accel_path): Add
a function to obtain the accel path of an action. (#148106,
Michael Natterer)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtk.symbols
gtk/gtkaction.c
gtk/gtkaction.h
gtk/gtkactiongroup.c
gtk/gtkactiongroup.h

index 557cb0c10bc129d1635bfe38fe46b92527185770..bca495a51ab5e7ab92aeadcf0c413d3bd1344310 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkaction.[hc]: 
+       * gtk/gtkactiongroup.[hc]: Make return types G_CONST_RETURN
+       instead of const.
+
+       * gtk/gtk.symbols: 
+       * gtk/gtkaction.h: 
+       * gtk/gtkaction.c (gtk_action_get_accel_path): Add
+       a function to obtain the accel path of an action. (#148106,
+       Michael Natterer)
+
        * tests/testiconview.c: Fix double-click activation.
 
        * gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip
index 557cb0c10bc129d1635bfe38fe46b92527185770..bca495a51ab5e7ab92aeadcf0c413d3bd1344310 100644 (file)
@@ -1,5 +1,15 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkaction.[hc]: 
+       * gtk/gtkactiongroup.[hc]: Make return types G_CONST_RETURN
+       instead of const.
+
+       * gtk/gtk.symbols: 
+       * gtk/gtkaction.h: 
+       * gtk/gtkaction.c (gtk_action_get_accel_path): Add
+       a function to obtain the accel path of an action. (#148106,
+       Michael Natterer)
+
        * tests/testiconview.c: Fix double-click activation.
 
        * gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip
index 557cb0c10bc129d1635bfe38fe46b92527185770..bca495a51ab5e7ab92aeadcf0c413d3bd1344310 100644 (file)
@@ -1,5 +1,15 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkaction.[hc]: 
+       * gtk/gtkactiongroup.[hc]: Make return types G_CONST_RETURN
+       instead of const.
+
+       * gtk/gtk.symbols: 
+       * gtk/gtkaction.h: 
+       * gtk/gtkaction.c (gtk_action_get_accel_path): Add
+       a function to obtain the accel path of an action. (#148106,
+       Michael Natterer)
+
        * tests/testiconview.c: Fix double-click activation.
 
        * gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip
index 557cb0c10bc129d1635bfe38fe46b92527185770..bca495a51ab5e7ab92aeadcf0c413d3bd1344310 100644 (file)
@@ -1,5 +1,15 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkaction.[hc]: 
+       * gtk/gtkactiongroup.[hc]: Make return types G_CONST_RETURN
+       instead of const.
+
+       * gtk/gtk.symbols: 
+       * gtk/gtkaction.h: 
+       * gtk/gtkaction.c (gtk_action_get_accel_path): Add
+       a function to obtain the accel path of an action. (#148106,
+       Michael Natterer)
+
        * tests/testiconview.c: Fix double-click activation.
 
        * gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip
index 39ac93de7242b1edc46c494dc9ea589052cf9a13..4205c828ae9fa7151822c8a7f4578d84c65034df 100644 (file)
@@ -91,6 +91,7 @@ gtk_action_create_menu_item
 gtk_action_create_tool_item
 gtk_action_disconnect_accelerator
 gtk_action_disconnect_proxy
+gtk_action_get_accel_path
 gtk_action_get_name
 gtk_action_get_proxies
 gtk_action_get_sensitive
index abd1a718ebc75acf2734f0685a0f9ea59c5cc3eb..d77f5488ca33de32e08f4edb2448306fb92b20b8 100644 (file)
@@ -1193,7 +1193,7 @@ gtk_action_get_proxies (GtkAction *action)
  *
  * Since: 2.4
  **/
-const gchar *
+G_CONST_RETURN gchar *
 gtk_action_get_name (GtkAction *action)
 {
   g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
@@ -1438,6 +1438,30 @@ gtk_action_set_accel_path (GtkAction   *action,
   action->private_data->accel_quark = g_quark_from_string (accel_path);
 }
 
+/**
+ * gtk_action_get_accel_path:
+ * @action: the action object
+ *
+ * Returns the accel path for this action.  
+ *
+ * Since: 2.6
+ *
+ * Returns: the accel path for this action, or %NULL
+ *   if none is set. The returned string is owned by GTK+
+ *   and must not be freed or modified.
+ */
+G_CONST_RETURN gchar *
+gtk_action_get_accel_path (GtkAction *action)
+{
+  g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
+
+  if (action->private_data->accel_quark)
+    return g_quark_to_string (action->private_data->accel_quark);
+  else
+    return NULL;
+}
+
+
 /**
  * gtk_action_set_accel_group:
  * @action: the action object
index 6449748608e063be33e866aa8f38b4fa41a5e3c6..193e9dcd833d76a6a8aa2bc3330214849ed18ede 100644 (file)
@@ -85,7 +85,7 @@ GtkAction   *gtk_action_new                    (const gchar *name,
                                                const gchar *label,
                                                const gchar *tooltip,
                                                const gchar *stock_id);
-const gchar* gtk_action_get_name               (GtkAction     *action);
+G_CONST_RETURN gchar* gtk_action_get_name      (GtkAction     *action);
 gboolean     gtk_action_is_sensitive           (GtkAction     *action);
 gboolean     gtk_action_get_sensitive          (GtkAction     *action);
 void         gtk_action_set_sensitive          (GtkAction     *action,
@@ -106,6 +106,7 @@ void         gtk_action_disconnect_proxy       (GtkAction     *action,
 GSList*      gtk_action_get_proxies            (GtkAction     *action);
 void         gtk_action_connect_accelerator    (GtkAction     *action);
 void         gtk_action_disconnect_accelerator (GtkAction     *action);
+G_CONST_RETURN gchar *gtk_action_get_accel_path (GtkAction     *action);
 
 /* protected ... for use by child actions */
 void         gtk_action_block_activate_from    (GtkAction     *action,
index f081dc3dc56a1145ef2e90a69897b47ec7ae3d65..7b22d7ae6ef3a9ee6eb656cdf92a43e86a3f36ba 100644 (file)
@@ -387,7 +387,7 @@ gtk_action_group_real_get_action (GtkActionGroup *self,
  * 
  * Since: 2.4
  */
-const gchar *
+G_CONST_RETURN gchar *
 gtk_action_group_get_name (GtkActionGroup *action_group)
 {
   g_return_val_if_fail (GTK_IS_ACTION_GROUP (action_group), NULL);
index 138ed03c22f03da8503af438997818c2e06339c4..5469e8f2245a2f3816d5908be620271791f7d5c9 100644 (file)
@@ -105,7 +105,7 @@ struct _GtkRadioActionEntry
 
 GType           gtk_action_group_get_type                (void);
 GtkActionGroup *gtk_action_group_new                     (const gchar                *name);
-const gchar    *gtk_action_group_get_name                (GtkActionGroup             *action_group);
+G_CONST_RETURN gchar *gtk_action_group_get_name          (GtkActionGroup             *action_group);
 gboolean        gtk_action_group_get_sensitive           (GtkActionGroup             *action_group);
 void            gtk_action_group_set_sensitive           (GtkActionGroup             *action_group,
                                                          gboolean                    sensitive);